//
//  CMDBGetRelatedUser2Home.swift
//  CMDB
//
//  Created by 曹桂祥 on 2017/5/23.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBGetRelatedUser2HomeManage: NSObject {
    
    static let getInstance : CMDBGetRelatedUser2HomeManage = CMDBGetRelatedUser2HomeManage()
    
    private override init() {
        super.init()
    }
}

extension CMDBGetRelatedUser2HomeManage{
    
    func queryHomeRelatedUserList(getRelatedUsers2HomeParam : CMDBGetRelatedUsers2HomeParam,tableView : UITableView,handler : CMDBRealatedListHandler,error : CMDBHttpErrorHandler,failure : CMDBHttpFailureHandler){
    
        CMDBHttpManager.getInstance.request(getRelatedUsers2HomeParam.URLString(), param: getRelatedUsers2HomeParam.keyValues, success: { (sysTime, data, page) in
            
            var users = [CMDBRelatedUserBean]()
            
            if data != nil{
                users = (CMDBRelatedUserBean.objectArrayWithKeyValuesArray(data as! NSArray) as? Array<CMDBRelatedUserBean>)!
            }else{
                
            }
            
            
            handler(homeRelatedUser:users)
            
            }, error: { (rescode) in
                
            }) { 
                
        }
        
        
    }
    
    
    
}